Repository navigation
[Feat] 스케줄링을 위한, S3 URL을 반환하는 신고글 랜덤 조회 기능 구현 - #155
Conversation
…준 하루 전 공고를 반환함
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Test Results390 tests 390 ✅ 1m 10s ⏱️ Results for commit 5cc75d9. |
📊 JaCoCo Coverage
|
JangIkhwan
left a comment
There was a problem hiding this comment.
꼼꼼한 테스트가 좋았어요! 고생하셨습니다.
|
|
||
| List<String> imageUrls = report.getReportImages().stream() | ||
| .map(ReportImage::getImageUrl) | ||
| .filter(url -> url != null && !url.isBlank()) | ||
| .distinct() | ||
| .toList(); | ||
|
|
There was a problem hiding this comment.
예전에 작성해주신 신고글 저장 로직을 보면 이미지 URL 중복을 제거하시긴 하던데, 여기서도 중복 제거를 수행하네요. 의도하신건가요??
There was a problem hiding this comment.
음 저장 시에 중복제거를 수행하긴 하지만 조회 단에서도 방어적으로 한번 더 검증하는 것이 좋겠다 싶어서 넣긴 했어요. 물론 저장 시에만 제거해도 웬만한 경우에는 DB에 중복이 안 들어갈 거긴 합니다만, 버그나 기타 상황을 생각하고 중복제거를 수행했습니다!
| // given | ||
| MissingReport report1 = mock(MissingReport.class); | ||
| MissingReport report2 = mock(MissingReport.class); | ||
|
|
There was a problem hiding this comment.
테스트를 작성해보면서 느낀 건데 도메인이나 DTO는 mock하지 않는 것도 괜찮은 것 같더라고요. 나중에 테스트 코드가 수정되면 mocking할게 늘어나서 조금 귀찮을 수도 있거든요. 근데 지금도 괜찮긴합니다! 👍
Related issue 🛠
Work Description 📝
파이썬 스케줄러에서 호출해서 인스타그램 홍보용 컨텐츠 자동 생성에 활용할 용도로 활용되는 API입니다. 기존 보호글 랜덤 조회 기능 말고 신고글 랜덤 조회도 필요하다는 요청이 있어 구현했습니다.
보호글 랜덤 조회 기능과 로직이 거의 동일하지만, s3로 업로드 하는 로직이 불필요하기에, 해당 부분만 상이합니다.
MissingReportDetailStrategy에 공통 매핑 메서드를 추가했습니다. (toDetailDto)
Screenshot 📸
Uncompleted Tasks 😅
To Reviewers 📢